<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var b = 'window';

        function c() {
            console.log(b)
            console.log(this.b)
        }

        var obj = {
            b: '1-1',
            c: function () {
                console.log(b)
                console.log(this.b)
                return {
                    b: '1-2',
                    c: function () {
                        console.log(b)
                        console.log(this.b)
                    }
                }
            },
        }
        c()
        obj = obj.c()
        obj.c = c
        obj.c()
    </script>
</body>

</html>